<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>登录</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/bower_components/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="/bower_components/Ionicons/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="/dist/css/AdminLTE.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="/plugins/iCheck/square/green.css">
    <!--[if lt IE 9]>
    <script src="/bower_components/html5shiv/html5shiv.min.js"></script>
    <script src="/bower_components/respond/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition login-page ">
<div class="login-box">
    <div class="login-logo">
        <b text="你好">欢迎使用,请登录</b>
        <span text="fafa"></span>
    </div>
    <!-- /.login-logo -->
    <div class="login-box-body">
        <p class="login-box-msg"></p>
        <form id="form-login" action="/admin/login" method="post">
            <div class="alert alert-danger" th:if="${!#strings.isEmpty(loginError)}" th:text="${loginError}"></div>
            <input id="hidden-password" type="hidden" name="password">
            <div class="form-group has-feedback">
                <input type="text" data-minlength="3" class="form-control" placeholder="用户名或者邮箱" name="username"
                       maxlength="20" required="required">
                <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
                <div class="help-block with-errors"></div>
            </div>
            <div class="form-group has-feedback">
                <input id="ipt-password" type="password" data-minlength="6" class="form-control" placeholder="密码"
                       maxlength="20" required="required">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                <div class="help-block with-errors"></div>
            </div>
            <div class="row">
                <div class="col-xs-8">
                    <div class="checkbox icheck">
                        <label>
                            <input type="checkbox" name="rememberMe" value="true">
                            记住我
                        </label>
                    </div>
                </div>
                <!-- /.col -->
                <div class="col-xs-4">
                    <button type="submit" class="btn btn-primary btn-block btn-flat">登录</button>
                </div>
                <!-- /.col -->
            </div>
        </form>
    </div>
    <!-- /.login-box-body -->
</div>
<!-- /.login-box -->

<!-- jQuery 3 -->
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- iCheck -->
<script src="/plugins/iCheck/icheck.min.js"></script>
<!-- jquery-md5 -->
<script src="/bower_components/jquery-md5/jquery.md5.js"></script>
<!-- basil -->
<script src="/bower_components/basil/basil.min.js"></script>
<!-- bootstrap validator -->
<script src="/bower_components/bootstrap-validator/dist/validator.js"></script>
<script>
    $(function () {
        $('input').iCheck({
            checkboxClass: 'icheckbox_square-green'
        });
        $('#form-login').validator().on('submit', function (e) {
            if (e.isDefaultPrevented()) {
                return false;
            } else {
                //验证通过
                $("#hidden-password").val($("#ipt-password").val());
                return true;
            }
        })
    });
</script>
</body>
</html>
